This page last changed on Nov 19, 2008 by dhommel.

CruiseControl.NET provides basic support for Subversion repositories. Checking for changes, checking out or updating sources, and tagging-by-copying are supported, but more advanced features such as using Subversion revision numbers are not yet supported. Subversion support is under active development and will improve over time.

To configure the CruiseControl.NET server to monitor a Subversion repository, edit ccnet.config and configure sourcecontrol to point at your repository.

SVN Checkout
As of the CCNet 1.2 release, the SVN provider now supports automatic checkout of source. If the working directory does not contain a .svn folder (or _svn folder), the SVN block will automatically perform a checkout instead of an update. The trunkUrl must be specified for checkout to function.
<sourcecontrol type="svn">
	<trunkUrl>svn://svn.mycompany.com/myfirstproject/trunk</trunkUrl>
	<workingDirectory>c:\dev\ccnet</workingDirectory>
</sourcecontrol>

The <trunkUrl> tag should specify the URL to use to determine if changes have occurred in your repository.

You need to make sure your SVN client settings are such that all authentication is automated. Typically you can do this by using anonymous access or appropriate SSH setups if using SVN over SSH.

Configuration Elements:

Node Description Type Default Required
trunkUrl The url for your repository (e.g., svn://svnserver/) string N/A Only if autoGetSource=true
workingDirectory The directory containing the locally checked out workspace. string The project working directory false
executable The location of the svn executable string "svn.exe" false
username The username to use for authentication when connecting to the repository. string N/A false
password The password to use for authentication when connecting to the repository. string N/A false
autoGetSource Whether to retrieve the updates from Subversion for a particular build. bool true false
checkExternals Whether to check the paths specified in the svn:externals property for modifications. bool false false
checkExternalsRecursive Whether to check for modifications of svn:externals recursively. bool true false
cleanCopy Whether to delete the working copy before updating the source. bool false false
webUrlBuilder The root url for the WebSVN site string N/A false
tagOnSuccess Indicates that the repository should be tagged if the build succeeds. bool false false
tagBaseUrl The base url for tags in your repository. string false false
timeout Sets the timeout period for the source control operation. See Timeout Configuration for details. Timeout 10 minutes false
issueUrlBuilder Converts the comment (or parts from it) into an url pointing to the issue for this build.
See Issue Builder for more details
Group N/A false

Linking modifications to WebSVN

You can link the modifications detected by CruiseControl.NET to the appropriate WebSVN page by adding the following additional configuration information to the Subversion source control section:

<webUrlBuilder type="websvn">
                <url>http://localhost:7899/websvn/diff.php?repname=MiniACE&amp;path={0}&amp;rev={1}&amp;sc=1</url>
</webUrlBuilder>

Change the <url> element to point to the root url for the WebSVN site. The path and rev parameters will be filled in by CruiseControl.NET when it generates the link to the code file page.

NOTE: The standard url for WebSVN 1.38 contains rep=3 r instead of repname=MiniACE. Adding a new repository to the SvnParentPath will change the number of the rep parameter, so you may need to make the following change to diff.php to decode the repname parameter:

$repname = @$_REQUEST["repname"];

if (isset($repname))
{
    $rep = $config->findRepository($repname);
}

The WebSVN WebUrlBuilder can also be used to connect to a ViewCV site. Here is an example used by CCNet to link to the file revision pages on SourceForge.

<webUrlBuilder type="websvn">
   <url>http://svn.sourceforge.net/viewvc/ccnet/{0}?view=markup&pathrev={1}</url>
</webUrlBuilder>

SVN over SSL

When connecting to a Subversion repository via SSL (https), you may be required to accept an issued server certificate. This generally requires responding to a command-line prompt that the certificate should be accepted permanently. For CruiseControl.NET, all Subversion commands are executed using the --non-interactive switch, which will cause this prompt to be skipped and the subsequent Subversion command to fail with a message like this:

svn: PROPFIND request failed on '/svnroot/ccnet'
svn: PROPFIND of '/svnroot/ccnet': Server certificate verification failed: issuer is not trusted (https://ccnet.svn.sourceforge.net)

As the failure will happen on the first Subversion command to be executed, this failure will not show up as a broken build, but will instead show up in the server log.

One way to resolve this problem is to execute a command against the Subversion repository from the command-line logged in as the user that you are using to run CCNet (certificates are cached by user account, so you must accept the certificate for the appropriate user). For example, try executing the following command (where trunk_url is the svn url for your repository):

svn list [trunk_url]

When prompted to accept the certificate, type 'P' to permanently accept it.

If you are running CCService under the LocalSystem account, you will need to accept the certificate for this user. Check out the CCService page for information about how to diagnose problems as the LocalSystem account.

External contributors:

  • Matt Petteys

SVN over svn+ssh

To connect to Subversion with the svn+ssh protocol, here is an excerpt from the article HowTo: Configure SVN+SSH with Subclipse on Windows by Martin Woodward. For more details, see the complete article.

HowTo: Configure SVN+SSH with Subclipse on Windows

Solution:
You need to create an environment variable called "SVN_SSH" that points to an executable file that accepts the same command line arguments as ssh on unix. I did this by doing the following:-

  1. Set up ssh keys. Not going to cover that here as you can easily Google for that. You need to end up with your public key on the SVN server and your private key loaded into Paegent locally.
  2. Download and installed the excellent TortoiseSVN client for Windows.
  3. Set the following environment variable (by right-clicking on My Computer, Properties, Advanced, Environment Variables, New):-
    Variable name: SVN_SSH
    Variable value: C:\\Program Files\\TortoiseSVN\\bin\\TortoisePlink.exe
    
    The "\ \"(double-back-slash) is very important, otherwise it won't work. Equally, you cannot use the plink.exe that comes with putty as that fires up a command shell window which is really annoying. The TortoisePlink.exe is a windows implementation of plink that doesn't bring up any UI

Known Issues

CruiseControl.NET doesn't see my changes

The Subversion interface depends on the clocks of the CruiseControl.Net and Subversion servers being set within a small difference. Due to a long-standing Subversion bug (Bugzilla #1642) that appears unlikely to ever be fixed, CruiseControl.Net must filter the list of modifications returned by Subversion, looking for only those that fall within a specific time range. When the clocks of the two servers are significantly different, the filter may ignore modifications that should not be ignored. To prevent this problem, keep the clocks of the two servers set as closely together as possible.

Dashboard Localization (issues with SVN)

I've found that svn has a trouble with --xml parameter. My russian Log Messages were not readable.
I found a quick solution for it, next items could be customized to any languges. But be sure this is not the panacea.
So in all .xsl files where comments or filename in Russian local I've added folowing "translation"

<xsl:value-of select="translate(comment,'??????????????????????????????????????????????????????????????????','????????????????????????????????????????????????????????????????')"/>

where comment from /cruisecontrol/modifications/modification, and "??" in second parameter are symbols to delete, all others are mathed with third parameters. As I found xsl could only translate char strings , if some one know the way to translate double-char symbols, please note about it.
In this way you can help your self for modification for any charset.
I agree with everyone that it is a rude solution. But for my no time to wait untill svn or cc.net will be customized for that feature.

Document generated by Confluence on Mar 14, 2009 02:55